package tweeks.user.dao;

import javax.sql.DataSource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import tweeks.user.domain.User;

@Repository
public class UserDaoJdbc implements UserDao {
	private JdbcTemplate jdbcTemplate;
	
	public void setDataSource(DataSource dataSource) {
		this.jdbcTemplate = new JdbcTemplate(dataSource);
	}
	
	public void addUser(final User user) {
//		this.jdbcTemplate.update("insert into user(uuid, id, password, name, level, login, recommend) values(?, ?, ?, ?, ?, ?, ?)"
//				, user.getUuid(), user.getId(), user.getPassword(), user.getFirstName()(), user.getLevel(), user.getLogin(), user.getRecommend());
	}
	
	public void deleteAll() {
		this.jdbcTemplate.update("delete from user");
	}
}
